home *** CD-ROM | disk | FTP | other *** search
- Path: news.spies.com!usenet
- From: Erik Max Francis <max@alcyone.com>
- Newsgroups: comp.lang.c
- Subject: Re: Is there a problem using memset on a malloc'd memory in HP-C
- Date: Fri, 29 Mar 1996 14:22:59 -0800
- Organization: Alcyone Systems
- Message-ID: <315C62C3.677EF741@alcyone.com>
- References: <31a7cc$10b20.32c@NEWS>
- NNTP-Posting-Host: newton.alcyone.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.01 (X11; I; Linux 1.2.13 i486)
-
- Jonathan Julian wrote:
-
- > I am having trouble doing a malloc on memory that I allocated via
- > malloc. I malloc'd the memory, memset it and immediately look at it
- > and it is garbage. I have changed my mallocs to callocs, but later in
- > my code I realloc. Since realloc does not initialize and I
- > distrusting of memset I have written a loop to initialize my memory.
-
- It's possible that it's a bug in your standard libraries, but more likely it's
- just something subtly wrong that you're doing. Take the code which causes the
- problem and strip it down to its simplest form, then ask again with a code
- fragment which demonstrates the problem.
-
- --
- Erik Max Francis &tSftDotIotE && http://www.alcyone.com/max && max@alcyone.com
- San Jose, California, U.S.A. && 37 20 07 N 121 53 38 W && the 4th R is respect
- H.3`S,3,P,3$S,#$Q,C`Q,3,P,3$S,#$Q,3`Q,3,P,C$Q,#(Q.#`-"C`- && 1love && folasade
- Omnia quia sunt, lumina sunt. && Dominion, GIGO, GOOGOL, Omega, Psi, Strategem
- "Out from his breast/his soul went to seek/the doom of the just." -- _Beowulf_
-